using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Assign Default To Field</para>
    /// <para>Creates a default value for a specified field.  When a new row is added to the table or feature class, the specified field will be set to this default value.</para>
    /// <para>为指定字段创建默认值。 将新行添加到表或要素类时，指定字段将设置为此默认值。</para>
    /// </summary>    
    [DisplayName("Assign Default To Field")]
    public class AssignDefaultToField : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AssignDefaultToField()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The input table or feature class that will have a default value added to one of its fields.</para>
        /// <para>将向其中一个字段添加默认值的输入表或要素类。</para>
        /// </param>
        /// <param name="_field_name">
        /// <para>Field Name</para>
        /// <para>The field to which the default value will be added each time a new row is added to the table or feature class.</para>
        /// <para>每次向表或要素类添加新行时将向其添加默认值的字段。</para>
        /// </param>
        public AssignDefaultToField(object _in_table, object _field_name)
        {
            this._in_table = _in_table;
            this._field_name = _field_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Assign Default To Field";

        public override string CallName => "management.AssignDefaultToField";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _field_name, _default_value, _subtype_code, _clear_value.GetGPValue(), _out_table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The input table or feature class that will have a default value added to one of its fields.</para>
        /// <para>将向其中一个字段添加默认值的输入表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Field Name</para>
        /// <para>The field to which the default value will be added each time a new row is added to the table or feature class.</para>
        /// <para>每次向表或要素类添加新行时将向其添加默认值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field_name { get; set; }


        /// <summary>
        /// <para>Default Value</para>
        /// <para>The default value to be added to each new table or feature class. The value entered must match the data type of the field. If the field chosen has a coded value domain assigned to it, the values from the coded domain will be included in the parameter value list..</para>
        /// <para>要添加到每个新表或要素类的默认值。输入的值必须与字段的数据类型匹配。如果所选字段分配了编码值域，则编码域中的值将包含在参数值列表中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Default Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _default_value { get; set; } = null;


        /// <summary>
        /// <para>Subtype</para>
        /// <para>The subtypes that can participate in the default value.</para>
        /// <para>可以参与默认值的子类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Subtype")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _subtype_code { get; set; } = null;


        /// <summary>
        /// <para>Clear Value</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the default value for either the field or the subtype will be cleared. The Default Value parameter must be empty to clear the default value of the field. To clear the default value for the subtype, leave the Default Value parameter empty and specify the subtype to be cleared.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The default value will be cleared (set to null). The default value parameter must be empty.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The default value will not be cleared. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否清除字段或子类型的默认值。默认值参数必须为空才能清除字段的默认值。若要清除子类型的默认值，请将“默认值”参数留空，并指定要清除的子类型。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 默认值将被清除（设置为 null）。默认值参数必须为空。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会清除默认值。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Clear Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _clear_value_value _clear_value { get; set; } = _clear_value_value._false;

        public enum _clear_value_value
        {
            /// <summary>
            /// <para>CLEAR_VALUE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLEAR_VALUE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_CLEAR</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_CLEAR")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        public AssignDefaultToField SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}